import java.util.*;

public class Question1 {
    // 9 3 100 200 300 400 500 600 700 800 900
    //

    // 100 200 300 400 500 / 600 700 / 800 900
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int numOfNums = scanner.nextInt();
        int numOfGaps = scanner.nextInt();
        if (numOfNums < 1 || numOfGaps < 1 || numOfNums <= numOfGaps){
            return;
        }
        int[] nums = new int[numOfNums];
        for (int i = 0; i < numOfNums ; i++){
            nums[i] = scanner.nextInt();
        }
        System.out.println(Arrays.toString(nums));
        List<Integer[]> list = new LinkedList<>();
        Integer[] indexs = new Integer[numOfGaps];
        getSumMinIndexs(nums,numOfGaps,numOfGaps,0,nums.length - 1,list,indexs);

        Integer[] res = new Integer[numOfGaps];
        int min = Integer.MAX_VALUE;
        for (Integer[] item : list) {
            if (getSum(item,nums) < min){
                min = getSum(item,nums);
                res = item;
            }

        }

        int n = numOfGaps - 1;
        for (int j = 0;j < nums.length - 1; j++){
            System.out.print(nums[j] + " ");
            if (n >= 0 && j == res[n]){
                System.out.print("/" + " ");
                n --;
            }
        }
        System.out.print(nums[nums.length - 1]);

    }

    private static Integer getSum(Integer[] Indexs, int[] nums) {
        int max = Integer.MIN_VALUE;
        int res = 0;
        int start = 0;
        for (int i = 0 ;i < Indexs.length; i++){
            for (int j = start ; j <= Indexs[i] ; j ++){
                res += nums[j];
            }
            if (max < res){
                max = res;
            }
            res = 0;
            start = Indexs[i] + 1;
        }
        for (int j = Indexs[Indexs.length - 1] ; j < nums.length ; j ++){
            res += nums[j];
        }
        if (max < res){
            max = res;
        }

        return max;
    }

    private static void getSumMinIndexs(int[] nums,int numOfGaps, int k, int start, int end, List<Integer[]> list, Integer[] indexs) {
        if (start >= end){
            return ;
        }
        if (k <= 0){
            Integer[] temp = new Integer[numOfGaps];
            for (int i = 0;i < numOfGaps ; i ++){
                temp[i] = indexs[i];
            }
            list.add(temp);
            return ;
        }
        for (int i = start; i < nums.length - k;i ++){
            indexs[k - 1] = i;
            getSumMinIndexs(nums,numOfGaps,k - 1,i + 1,end,list,indexs);
        }

    }
}
